home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00a.txt
/
000057_icon-group-sender _Mon Apr 10 10:15:07 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA11195
for icon-group-addresses; Mon, 10 Apr 2000 10:14:54 -0700 (MST)
Message-Id: <200004101714.KAA11195@baskerville.CS.Arizona.EDU>
Date: Mon, 10 Apr 2000 09:58:51 -0700
From: Steve Wampler <swampler@noao.edu>
X-Accept-Language: en
To: "F.G. van DORP" <F.G.van.Dorp@digimedia.nl>,
icon-group <icon-group@optima.CS.Arizona.EDU>
Subject: Re: Reversible assignment really reversible ?
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
"F.G. van DORP" wrote:
>
> # WINICON 9.3.1
>
> procedure main()
> local i1,i2,i3,j1,j2,k,a1,a2,a3
> i1:=2
> j1:=4
> i2:=4; i3:=i2
> j2:=2
> k:=3
>
> # co-exp creation & @ctivation not really necessary
> a1:=create((i1 <- j1) > k)
> a2:=create((i2 <- j2) > k)
> a3:=create(((i2:=j2)|(i2:=i3)) > k)
>
> write(@a3)
> write("co-exp1: ",@a1)
> write("nested1: ",((i1 <- j1) > k))
> write("muteva1: ",((i1 <- j1) & (i1 > k)))
>
> # the following set doesn't work, so is <-
> # really implemented or just an alias for := ?
> write("co-exp2: ",@a2)
> write("nested2: ",((i2 <- j2) > k))
> write("muteva2: ",((i2 <- j2) & (i2 > k)))
>
> end
Reversible assignment really works, but not as you're picturing its use.
The assignment is reversible only so long as you're staying in the same
evaluation context (w.r.t. success and failure). That is, the assignment
reverses ONLY if you backtrack into it. Try the following:
i1 := 0
every write("i1 is ", i1 <- 1 to 3)
write("i1 is now ", i1)
Also note that reversible assignment fails after it has reversed itself.
--
Steve Wampler- SOLIS Project, National Solar Observatory
swampler@noao.edu